package com.baizhiedu.rsm.service.impl;

import com.baizhiedu.rsm.dao.ClassMessageDao;
import com.baizhiedu.rsm.entity.ClassMessage;
import com.baizhiedu.rsm.service.ClassMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lby
 */
@Service
public class ClassMessageServiceImpl implements ClassMessageService {
    @Autowired
    private ClassMessageDao classMessageDao;

    @Override
    public List<ClassMessage> showAll() {
        return classMessageDao.selectAll();
    }

    @Override
    public String addNewClass(ClassMessage classMessage) {
        try{
            classMessageDao.insert(classMessage);
        }catch (Exception e){
            return "false";
        }
        return "true";
    }
}
